package net.xiaowenhou.demo.model;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;

public class User {

    @NotEmpty(message = "Parameter id can not be null")
    private Long id;

    @NotEmpty(message = "Parameter userName can not be null")
    private String userName;

    @NotEmpty(message = "Parameter passWord can not be null")
    @Length(min = 6, message = "The password can not be less than 6 ")
    private String passWord;

    @NotEmpty(message = "Parameter userSex can not be null")
    private String userSex;

    @NotEmpty(message = "Parameter nickName can not be null")
    private String nickName;

    public User(){
        super();
    }

    public User(String userName, String passWord, String userSex, String nickName) {
        this.userName = userName;
        this.passWord = passWord;
        this.userSex = userSex;
        this.nickName = nickName;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassWord() {
        return passWord;
    }

    public void setPassWord(String passWord) {
        this.passWord = passWord;
    }

    public String getUserSex() {
        return userSex;
    }

    public void setUserSex(String userSex) {
        this.userSex = userSex;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }


    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", userName='" + userName + '\'' +
                ", passWord='" + passWord + '\'' +
                ", userSex='" + userSex + '\'' +
                ", nickName='" + nickName + '\'' +
                '}';
    }
}
